DEBUG=y
ifeq ($(DEBUG), y)
	DEBFLAGS = -O -g -DLDD_DEBUG
else
	DEBFLAGS = -O2
endif

EXTRA_CFLAGS += $(DEBFLAGS)
obj-m := scull.o

KDIR=/lib/modules/$(shell uname -r)/build
PWD=$(shell pwd)

default:
	$(MAKE) -C $(KDIR) M=$(PWD) modules

test: test1 test2 test3

test1: test1.c
	gcc -g -o test1 test1.c

test2: test2.c
	gcc -g -o test2 test2.c

test3: test3.c scull_common.h
	gcc -g -o test3 test3.c

clean:
	rm -fr *.o *~core *.ko *.mod.c *.order *.symvers *.markers test1 test2 \
		test3 .*cmd .tmp_versions

